#include <iostream>
#include <cstring>

int main()
{
    char src1[] = "Hello, world!";
    char dest1[20];

    // 使用 memcpy 进行内存拷贝
    memcpy(dest1, src1, sizeof(src1));
    std::cout << "Result of memcpy: " << dest1 << std::endl;

    char src2[] = "Overlap Example";
    // 让目标和源重叠
    memmove(src2 + 5, src2, 8); // 将 "Overlap" 移动到 "Example" 位置
    std::cout << "Result of memmove with overlap: " << src2 << std::endl;

    return 0;
}
